Skip to content

Conversation

@maxwondercorn
Copy link

@simonihmig

When using BsForm without Component.formElement's and @model the hasValidator getter generates an error because this.model does not exist.

The fix below and a test was added. Optional chaining has been available since Ember 3.15

  get hasValidator() {
    return !!this.model?.validate;
  }

Copy link
Collaborator

@simonihmig simonihmig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thank you!

@simonihmig simonihmig added the bug label Sep 26, 2020
@simonihmig simonihmig merged commit 0cc0f7a into ember-bootstrap:master Sep 26, 2020
@simonihmig
Copy link
Collaborator

@maxwondercorn released in v2.0.1!

@maxwondercorn maxwondercorn deleted the fix/hasValidator branch September 28, 2020 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants